home *** CD-ROM | disk | FTP | other *** search
/ Champak 62 / Volume 62 - JOGO DISK .iso / Games / my-shop-dress-up.swf / scripts / frame_3 / DoAction.as
Text File  |  2008-03-17  |  1KB  |  45 lines

  1. function selectCharacter(id)
  2. {
  3.    if(selectedChar1 == undefined)
  4.    {
  5.       selectedChar1 = id;
  6.       attachMovie("photo" + id,"char" + id,1);
  7.       this["char" + id]._x = photo1._x;
  8.       this["char" + id]._y = photo1._y;
  9.    }
  10.    else if(selectedChar2 == undefined)
  11.    {
  12.       selectedChar2 = id;
  13.       attachMovie("photo" + id,"char" + id,2);
  14.       this["char" + id]._x = photo2._x;
  15.       this["char" + id]._y = photo2._y;
  16.       var i = 1;
  17.       while(i <= 4)
  18.       {
  19.          this["select" + i].enabled = 0;
  20.          i++;
  21.       }
  22.       nextButton._visible = 1;
  23.    }
  24. }
  25. stop();
  26. nextButton._visible = 0;
  27. nextButton.onPress = function()
  28. {
  29.    _root["char" + selectedChar1].removeMovieClip();
  30.    _root["char" + selectedChar2].removeMovieClip();
  31.    nextFrame();
  32. };
  33. selectedChar1 = undefined;
  34. selectedChar2 = undefined;
  35. var i = 1;
  36. while(i <= 4)
  37. {
  38.    this["select" + i].index = i;
  39.    this["select" + i].onRelease = function()
  40.    {
  41.       _root.selectCharacter(this.index);
  42.    };
  43.    i++;
  44. }
  45.